
import request from '@/utils/request'
/**
 * 获取所有的部门
 * @returns
 */

export function getempolyess() {
  return request({
    url: '/sys/user/simple',
    method: 'get'
  })
}

/**
 * 获取所有的员工
 * @returns
 */

export function getaddempolyess(params) {
  return request({
    url: '/sys/user',
    method: 'get',
    params
  })
}

/**
 * 添加
 * @returns
 */

export function addempolyess(data) {
  return request({
    url: '/sys/user',
    method: 'post',
    data
  })
}

/**
 * 删除
 * @returns
 */

export function delempolyess(id) {
  return request({
    url: `/sys/user/${id}`,
    method: 'delete'
  })
}

/**
 * @description: 导入excel
 * @param {*} data
 * @return {*}
 */
export function importEmployess(data) {
  return request({
    url: '/sys/user/batch',
    method: 'post',
    data
  })
}

/**
 * 保存员工信息
 * @returns
 */

export function saveempolyess(data) {
  return request({
    url: `/sys/user/${data.id}`,
    method: 'put',
    data
  })
}
// 打印
export function getJobDetail(id) {
  return request({
    url: `/employees/${id}/jobs`,
    method: 'get'
  })
}
